const express = require("express");
const router = express.Router();

// get query传参
router.get("/", (req, res, next) => {
  const { name, age } = req.query;
  const msg = JSON.stringify({
    name: name,
    age: age,
  });
  res.send(msg);
  res.end();
});

// 登入
router.post("/login", async (req, res, next) => {
  res.send("login");
});

// 登出
router.post("/logout", (req, res, next) => {
  res.send("logout");
});

module.exports = router;
